<template>
  <n-config-provider
    preflight-style-disabled
    :locale="zhCN"
    :date-locale="dateZhCN"
    :breakpoints="{ xs: 0, s: 768, m: 992 }"
    :theme-overrides="themeLight"
  >
    <n-message-provider>
      <n-notification-provider>
        <n-dialog-provider>
          <router-view v-if="isRouterAlive" />
        </n-dialog-provider>
      </n-notification-provider>
    </n-message-provider>
  </n-config-provider>
</template>

<script setup>
import { zhCN, dateZhCN } from 'naive-ui'

//强制刷新
const isRouterAlive = ref(true)
const reload = () => {
  isRouterAlive.value = false
  nextTick(function () {
    isRouterAlive.value = true
  })
}
provide('reload', reload)

const themeLight = {
  Layout: {
    // color: '#F8F8F8',
    // headerColor: '#445873'
  },
  common: {
    primaryColor: '#ffa157',
    primaryColorHover: '#ff9440',
    primaryColorPressed: '#d47b35',
    primaryColorSuppl: '#d48e57',
    errorColor: '#d44124',
    errorColorHover: '#bf513b',
    errorColorPressed: '#ab2c13'
    // successColor: '#3CA36C',
    // successColorHover: '#4BCC83'
  }
}
</script>

<style></style>
